package com.hr.mes.utils;

import com.github.pagehelper.PageInfo;
import com.hr.mes.dto.Page;

public class PageUtil {

    public static <T> Page<T> ConvertPageInfoToPage(PageInfo<T> pageInfo){
        Page<T> page = new Page<>();
        page.setPageNo(pageInfo.getPageNum());
        page.setPageSize(pageInfo.getPageSize());
        page.setTotal(pageInfo.getTotal());
        page.setPageCount(pageInfo.getPages());
        page.setHasPrePage(pageInfo.isHasPreviousPage());
        page.setHasNextPage(pageInfo.isHasNextPage());
        page.setPage(pageInfo.getList());
        return page;
    }

}
